package com.itheima.system.demo1;

import javafx.scene.control.RadioMenuItem;

import java.util.Arrays;
import java.util.Scanner;

public class SystemTest {
    public static void main(String[] args) {
        int[] arr1 = {1, 2, 3, 4, 5};
        int[] arr2 = new int[8];

        //需求一: arr1copy到arr2
        System.arraycopy(arr1, 0, arr2, 0, arr1.length);
        System.out.println(Arrays.toString(arr2));

        System.out.println("===========");
        //需求二: arr1中的2,3,4,数据拷贝到arr2的3,4,5索引位置
        System.arraycopy(arr1, 1, arr2, 3, 3);
        System.out.println(Arrays.toString(arr2));

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个浮点数:");
        double num = sc.nextDouble();
        System.out.println(method(num));
    }

    public static long method(double num) {
        long round = Math.round(num);
        return round;
    }
}
